package Utils;

/**
 * Created by Administrator on 15-11-30.
 */
import android.content.Context;
import android.content.SharedPreferences.Editor;

public class ShareUtils {

    private static final String FILE_NAME = "weather";
    private static final String CITY_NAME = "cityName";

    public static String getCityName(Context context) {
        return context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE)
                .getString(CITY_NAME, "北京");
    }

    public static void setCityName(Context context, String value) {
        Editor editor = context.getSharedPreferences(FILE_NAME,
                Context.MODE_APPEND).edit();
        editor.putString(CITY_NAME, value);
        editor.commit();
    }

}
